<?php
    include "admin_type.php";

$id=$_REQUEST['id'];
$name=$_REQUEST['name'];
// var_dump($id);

mysqli_select_db($conn,"shopping");

   $sql = "update type set name='$name' where id='$id'";  //SQL模板

   $result=mysqli_query($conn,$sql);

    if (!$result){
        echo '数据更新失败！';
    }else{
        echo '数据更新成功！';
    }
    
    mysqli_close($conn);
?>
